<!DOCTYPE html>
<html>

<head>
    <meta name="layout" content="main"/>
    <g:set var="entityName" value="${message(code: 'account.label', default: 'Account')}"/>
    <title>渠道：${account.name}</title>
</head>

<body class="fixed-navbar fixed-sidebar">
<div class="small-header">
    <div class="hpanel">
        <div class="panel-body">
            <div id="hbreadcrumb" class="pull-right">
                <ol class="hbreadcrumb breadcrumb">
                    <li>贷款管理系统</li>
                    <li>
                        <g:link controller="bocAccount" action="index">渠道</g:link>
                    </li>
                    <li class="active">
                        <span>信息编辑</span>
                    </li>
                </ol>
            </div>

            <h2 class="font-light m-b-xs">
                渠道: ${this.account.name}
            </h2>
        </div>
    </div>
</div>

<div class="content animate-panel">
    <div class="row">
        <div class="hpanel hblue">
            <div class="panel-heading">
                渠道信息编辑
            </div>

            <div class="panel-body">
                <g:form id="${this.account?.id}" action="channelUpdate" method="PUT" class="form-horizontal">
                    <g:if test="${flash.message}">
                        <div class="message" role="status">${flash.message}</div>
                    </g:if>
                    <g:hasErrors bean="${this.account}">
                        <ul class="errors" role="alert">
                            <g:eachError bean="${this.account}" var="error">
                                <li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>>
                                    <g:message error="${error}"/>
                                </li>
                            </g:eachError>
                        </ul>
                    </g:hasErrors>
                    <div class="form-group">
                      <g:textField name="type.id" value="${com.next.AccountType.findByName('渠道')?.id}" class="hide"/>
                        <label class="col-md-3 control-label">所属机构</label>

                        <div class="col-md-3"><g:select name="parent.id" value="${this.account?.parent?.id}"
                                                        from="${com.next.Account.findAllByType(com.next.AccountType.findByName('机构'))}" optionKey="id"
                                                        optionValue="name" class="form-control" noSelection="${['null': '请选择']}"/></div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-3 control-label">渠道编号</label>

                        <div class="col-md-3"><g:textField name="code" value="${this.account?.code}"
                                                           class="form-control"/></div>
                    </div>
                        <div class="form-group">
                            <label class="col-md-3 control-label">渠道简称</label>

                            <div class="col-md-3"><g:textField name="name" value="${this.account.name}"
                                                               class="form-control"/></div>
                        </div>

                        <div class="form-group">
                            <label class="col-md-3 control-label">状态</label>
                            <div class="col-md-3 checkbox-inline">
                                <g:radioGroup class="checkbox-inline" name="active" value="${this.account?.active}" labels="['启用','禁用']" values="[true,false]">
                                    ${it.radio} ${it.label}
                                </g:radioGroup>
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-md-3 col-md-offset-3">
                                <g:submitButton class="btn btn-info" name="create" value="保存"/>
                            </div>
                        </div>
                </g:form>
            </div>
        </div>
    </div>
</div>

</body>

</html>
